<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
  <title>Tutorials</title>
</head>

<body>

<center>
<h1>Tutorials</h1>
</center>
<hr>

<p>On this page we will walk through two tutorials to help you get started with
JSimpleSim. The first tutorial will involve working with assembly source code,
which includes proper syntax and debugging. After assembling the source code,
the other tutorial will involve the basics of working with the machine while it
is running a program.</p>

<h2>Working with Assembly Code</h2>

<p>The assembly code is what you write to tell the simulator what to do. Let's
begin by opening the Assembly Editor window. Do this by clicking the Asm button
at the bottom of the main JSimpleSim window. A blank text editor will appear.
<br/><img src="../images/AssemblyEditorBlank.PNG"/></p>

<p>We will start off by opening an assembly source file that has already been
written. In this example, we will open a file called <code>prob5.asm</code>.
Select open from the file menu and browse for it. Check the screenshot to see
if you have the right file. <br/><img src="../images/prog6.PNG"/></p>

<p>Once you have the file open, the only thing to do with it is to assemble it.
Click the Assemble button at the bottom right corner of the window. If all goes
well, the code should assemble without any errors, and the Main Window should
take focus</p>

<p>From this point, normally you would resume work with the Main Window, but
we'll get to that in a moment. Go back to the Assembly Editor and make a change
to line 12. For example, replace the word "load" so that it says "ld". When you
click the Assemble button, an error will appear in the Error Console and will
on which line in the editor the error is located.</p>

<p>You will need to make sure that your syntax is compliant with the
instructions as they are documented on the <a href="../Machine/Instructions.html">Instructions</a> page.</p>

<h2>Working with an Assembled Program</h2>

<p>When you have a .asm file assembled, the values in the Main Memory table
will update accordingly. At this point, you can begin executing the program by
clicking the Run button. You can watch the execution at incremental steps by
clicking the Step button instead.</p>

<p>Cells in the Main Memory and Register tables that have had their values
changed will display said values in red.</p>

<p>Clicking the Disasm button at the bottom right corner of the window will
have an opposite effect of what the Assemble button did in the Assembly Editor.
The simulator will attempt to determine what the source code was from the
assembled code in the main window.</p>

<p></p>
</body>
</html>
